// run: $exec < input
// opt: 0
// flag: -g
#include <iostream>
#include <string>

long long const maxn = 500007;
long long left[maxn], right[maxn];
std::string s;
long long n, a, b, tim;

bool judge(long long mid, long long i)
{
	long long t = left[i] + right[mid] - right[0];
	t += i * a;
	return t <= tim;
}

bool judge2(long long mid, long long i)
{
	long long t = left[mid] + right[i] - right[0];
	t += i * a;
	return t <= tim;
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n >> a >> b >> tim;
	std::cin >> s;

	long long ans = 0, tl = n - 1, tr = n - 1;
	long long t = 0;
	for (long long i = 0; i < n; i++) {
		t += (s[i] == 'w') * b + 1;
		if (t > tim) { tr = i - 1; break; }
		right[i] = t;
		ans = std::max(ans, i + 1);
		t += a;
	}
	t = 0;
	for (long long i = 0; i < n; i++) {
		t += (s[(n - i) % n] == 'w') * b + 1;
		if (t > tim) { tl = i - 1; break; }
		left[i] = t;
		ans = std::max(ans, i + 1);
		t += a;
	}
	/*
	for (long long i = 0; i < n; i++) std::cout << left[i] << ' '; std::cout << '\n';
	for (long long i = 0; i < n; i++) std::cout << right[i] << ' '; std::cout << '\n';
	std::cout << tl << ' ' << tr << '\n';
	*/

	for (long long i = 0; i <= tl; i++) {
		long long l = 1, r = std::min(n - 1 - i, tr);
		if (r < l) continue;
		while (l + 1 < r) {
			long long mid = (l + r) / 2;
			if (judge(mid, i)) l = mid;
			else r = mid;
		}
		if (judge(r, i)) l = r;
		if (!judge(l, i)) continue;
		ans = std::max(ans, (i + l + 1));
	}
	for (long long i = 0; i <= tr; i++) {
		long long l = 1, r = std::min(n - 1 - i, tl);
		if (r < l) continue;
		while (l + 1 < r) {
			long long mid = (l + r) / 2;
			if (judge2(mid, i)) l = mid;
			else r = mid;
		}
		if (judge2(r, i)) l = r;
		if (!judge2(l, i)) continue;
		ans = std::max(ans, (i + l + 1));
	}
	std::cout << ans << '\n';
}

